package com.itheima.web.manager;

import cn.hutool.core.date.DateUtil;
import com.itheima.service.db.AnalysisByDayService;
import com.itheima.vo.AnalysisSummaryVo;
import com.itheima.vo.UsersVo;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;

@Component
public class AnalysisManager {

    @DubboReference
    private AnalysisByDayService analysisByDayService;

    //统计展示数据
    public ResponseEntity summary() {
        AnalysisSummaryVo analysisSummaryVo = analysisByDayService.findAnalysisSummaryVo();
        return ResponseEntity.ok(analysisSummaryVo);
    }


    //统计展示图
    public ResponseEntity users(String startTime, String endTime, String type) {
        UsersVo usersVo = analysisByDayService.findUsersVo(type, startTime, endTime);
        return ResponseEntity.ok(usersVo);

    }





}
